package com.bkjk.mongoToMysql;


import org.pentaho.di.trans.step.StepMeta;
import org.pentaho.di.trans.steps.mongodbinput.MongoDbInputMeta;

import com.bkjk.constant.MongoConstant;
import com.bkjk.utils.KettleUtils;

public class CustomPlugin {
	public static MongoDbInputMeta getCustomMongoInput(){
		MongoDbInputMeta mongoInputMeta  = KettleUtils.getMongoDbInputMeta();
		mongoInputMeta.setPort(MongoConstant.MONGO_PORT+"");
    	mongoInputMeta.setHostnames(MongoConstant.MONGO_HOST);
    	mongoInputMeta.setAuthenticationPassword(MongoConstant.DB_PASSWORD);
    	mongoInputMeta.setAuthenticationUser(MongoConstant.DB_USERNAME);
    	mongoInputMeta.setDbName(MongoConstant.DB_NAME);
    	mongoInputMeta.setAuthenticationDatabaseName(MongoConstant.AUTH_DB_NAME);
		return mongoInputMeta;
	}
	
	public static StepMeta getCustomMongoStepMeta(){
		StepMeta stepMeta = KettleUtils.getStepMeta();
		stepMeta.setLocation(MongoConstant.X,MongoConstant.Y);
		stepMeta.setStepID(MongoConstant.MONGO_STEP_ID);
		return stepMeta;
	}

}
